package com.eden.api.controller;

import com.eden.api.controller.vo.ApiResult;
import com.eden.school.domain.SchoolUser;
import com.eden.school.service.ISchoolUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import static com.eden.api.controller.vo.ApiResult.success;

/**
 * @program: eden
 * @description: ${description}
 * @author: Mr.Jiao
 * @create: 2021-04-01 16:36
 */

@Slf4j
@Api("个人信息修改")
@RestController
@RequestMapping("/api/myself")
public class ApiMyselfController {

    @Autowired
    private ISchoolUserService schoolUserService;

    //修改个人用户信息
    @ApiOperation("修改个人用户信息")
    @PostMapping("/updateMyself")
    public ApiResult updateMyself(@Validated @RequestBody SchoolUser mySelf) {
        schoolUserService.updateSchoolUser(mySelf);
        return success("修改成功！！！");
    }
}
